<?php 
return [
	'name' => '留言簿',
	'manager_url' => plugin_url('/guestbook/admin/index'),
	'description' => '在线留言',
	'version' => '1.0.0',
	'author' => '谢蕾',
	'weburl' => 'http://www.ebcms.com/',
	'hooks'=>[],
	'install' => function(){
		$sqls = [];
		$sqls[] = "DROP TABLE IF EXISTS `ebcms_guestbook`;";
		$sqls[] = <<<str
CREATE TABLE `ebcms_guestbook` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `contact` varchar(255) DEFAULT '' COMMENT '联系方式',
  `nickname` varchar(255) DEFAULT '' COMMENT '称呼',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `body` text COMMENT '内容',
  `create_time` int(10) unsigned DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='留言板';
str;
		foreach ($sqls as $sql) {
			$sql = str_replace('ebcms_', \mylib\Config::get('database.prefix'), $sql);
			\Ebcms::db() -> query($sql);
		}
		return true;
	},
	'uninstall' => function(){
		$sqls = [];
		$sqls[] = "DROP TABLE IF EXISTS `ebcms_guestbook`;";
		foreach ($sqls as $sql) {
			$sql = str_replace('ebcms_', \mylib\Config::get('database.prefix'), $sql);
			\Ebcms::db() -> query($sql);
		}
		return true;
	}
];